﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>安徽新闻出版学院运动会管理系统</title>
    <link href="<%=Url.Content("~/Content/main.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Content/tree.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Content/tab.css") %>" rel="stylesheet" type="text/css" />

    <script src="<%=Url.Content("~/Scripts/jquery-1.4.4.js") %>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/Plugins/jquery.tree.js") %>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/Plugins/jquery.tab.fader.js") %>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/Plugins/jquery.tab.js") %>" type="text/javascript"></script>

</head>
<body>
    <div class="MainContainer">
        <div id="top" class="top">
            <div class="title"></div>
            <div class="toolbar">
                <div class="rightc">
                    <a id="back" class='back'><span>后退</span></a> <a id="forward" class='forward'><span>
                        前进</span></a> <a id="reflash" class="reflash"><span>刷新</span></a> <a id="signout"
                            class="signout"><span>注销</span></a>
                </div>
            </div>
        </div>
        <div>
            <div id="left" class="left">
            </div>
            <div class="center">
                <div id="center">
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        var mheight = document.documentElement.clientHeight;
        var theight = $("#top").height();
        var height = mheight - theight - 8;
        //加载按钮事件
        $("#back").click(function() { history.back(); });
        $("#forward").click(function() { history.go(1); });
        $("#reflash").click(function() { document.location.reload(); });
        $("#signout").click(function() { alert("你没登录啊！"); });

        //修订窗口大小
        $(document).ready(ReSize);
        $(window).resize(ReSize);
        function ReSize() {
            var mheight = document.documentElement.clientHeight;
            var theight = $("#top").height();
            var height = mheight - theight - 8;
            $("#left").height(height);
            $("#center").height(height);
        }
        //加载左侧树形菜单
        $(document).ready(function() {
            $.ajax({
                type: "POST",
                contentType: "json",
                url: "Main/GetTreeRoot",
                onnodeclick: navi,
                success: function(data) {
                    var o = {
                        url: '<%=Url.Action("GetChildData")%>',
                        onnodeclick: navi
                    };
                    o.data = data;
                    $("#left").treeview(o);
                }
            });
            function navi(item) {
                if (item.ChildNodes) {
                    return;
                }
                tabpanel.addTab({
                    id: item.id,
                    title: item.text,
                    html: '<iframe src="' + item.value + '" width="100%" height="100%" frameborder="0"></iframe>',
                    closable: true,
                    disabled: false
                });
            }
        });
        var tabpanel;
        $(document).ready(function() {
            var mheight = document.documentElement.clientHeight;
            var theight = $("#top").height();
            var height = mheight - theight - 8;
            tabpanel = new TabPanel({
                renderTo: 'center',
                width: '100%',
                height: height,
                active: 0,
                autoResizable: true,
                items: [{
                    id: "home-page",
                    title: "home",
                    html: '<iframe src="Main/Welcome" width="100%" height="100%" frameborder="0"></iframe>',
                    closable: false,
                    disabled: false
}]
                });
            }); 
    </script>

</body>
</html>
